package com.xiaoshuidi.cloud.module.iot.enums;

import java.util.stream.Stream;

/**
 * @author Sky
 * create 2019/08/22
 * email sky.li@ixiaoshuidi.com
 **/
public enum AntBrandEnum {
    ANT_FENGDIAN(BrandEnum.ANT_FENGDIAN.getBrand(), "DP2018091400001"),
    ANT_DANBEI(BrandEnum.ANT_DANBEI.getBrand(), "DP2019042500001"),
    ANT_RUANKU(BrandEnum.ANT_RUANKU.getBrand(), "DP2019090900001"),
    ANT_YUNDING(BrandEnum.ANT_YUNDING.getBrand(), "LP2018071900001"),
    ANT_HONGANXING(BrandEnum.ANT_HONGANXING.getBrand(),"DP2019032500001"),
    ANT_YUEYUENIAO(BrandEnum.ANT_YUEYUENIAO.getBrand(),"DP2019072900001"),
    ANG_CHAOYI(BrandEnum.ANT_CHAOYI.getBrand(),"DP2019011800001");

    private String shuidiBrand;
    private String antBrand;

    AntBrandEnum(String shuidiBrand, String antBrand) {
        this.shuidiBrand = shuidiBrand;
        this.antBrand = antBrand;
    }

    AntBrandEnum() {
    }

    public String getShuidiBrand() {
        return shuidiBrand;
    }

    public void setShuidiBrand(String shuidiBrand) {
        this.shuidiBrand = shuidiBrand;
    }

    public String getAntBrand() {
        return antBrand;
    }

    public void setAntBrand(String antBrand) {
        this.antBrand = antBrand;
    }


    /**
     * 根据水滴蚂蚁品牌枚举查询蚂蚁品牌枚举
     *
     * @param brand
     * @return
     */
    public static AntBrandEnum getAntBrandEnum(String brand) {
        return Stream.of(AntBrandEnum.values()).filter(antBrandEnum -> brand.equals(antBrandEnum.getShuidiBrand())).findFirst().get();
    }

    /**
     * 根据蚂蚁品牌查询蚂蚁品牌枚举
     *
     * @param antBrand
     * @return
     */
    public static AntBrandEnum getAntBrandEnumByAntBrand(String antBrand) {
        return Stream.of(AntBrandEnum.values()).filter(antBrandEnum -> antBrand.equals(antBrandEnum.getAntBrand())).findFirst().get();
    }

}
